package mm.chenchen.utils;

import org.junit.Test;

import java.util.Calendar;
import java.util.List;

public class DateUtilsTest {


    @Test
    public void test1(){
        List<String> list=DateUtils.getIntervalTimeList("HH:mm:ss","02:00:00","24:00:00", Calendar.MINUTE,120);
        //List<String> list=DateUtils.getIntervalTimeList("yyyy-MM-dd","2021-01-01","2021-1-31", Calendar.DAY_OF_MONTH,1);
        list.forEach(System.out::println);
        Calendar calendar = Calendar.getInstance();
        System.out.println(DateUtils.convertDate2String("yyyy-MM-dd",calendar.getTime()));
        calendar.add(Calendar.MONTH,-1);
        System.out.println(DateUtils.convertDate2String("yyyy-MM-dd",calendar.getTime()));
    }
}
